package com.dfz.aliyun.design.pattern.c15.proxy;

public class ProxyImage implements Image{

    private RealImage realImage;
    private final String fileName;

    public ProxyImage(String fileName) {
        this.fileName = fileName;
    }

    @Override
    public void display() {
        if (null == realImage) {
            realImage = new RealImage(fileName);
        }

        realImage.display();
    }
}
